package pers.baiban.sqltoword;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Component;
import pers.baiban.sqltoword.util.GenerateUtil;

import javax.annotation.Resource;

@SpringBootApplication
@MapperScan({"pers.baiban.sqltoword.mapper"})
public class SqlToWordApplication {

    public static void main(String[] args) {
        SpringApplication.run(SqlToWordApplication.class, args);
    }

    @Component
    private static class StartupRunner implements ApplicationRunner {

        @Resource
        private GenerateUtil generateUtil;

        @Override
        public void run(ApplicationArguments args) {
            generateUtil.generate();
        }
    }
}